
var xcx_openid = GetQueryString('xcx_openid') || '';
var wx_openid = GetQueryString('wx_openid') || '';
var sid = GetQueryString('sid') || '';
if (xcx_openid || wx_openid) {
    var success = function (res) {
        var info = res.data.info;
        if (info != '' && info != undefined) {
            setCache(login_key,info);
            //判断是否有水票
            checkWaterBill();
        }
    }
    getData(member_info,{xcx_openid:xcx_openid,wx_openid:wx_openid,sid:sid},success);
}else {
    $('.mui-content').css('display','block');
}

//判断店面关闭状态
function checkShopStatus() {
    var success = function (res) {
        var status = parseInt(res.data.shop_status);
        if (status <= 0) { //如果关店，宣传页
            checkBack();
            redirect('call_person.html');
        }else { //未关，则留在当前
            $('.mui-content').css('display','block');
        }
    }
    getData(check_shop_status,comParams(),success);
}

//判断是否有水票
function checkWaterBill() {
    var success = function (res) {
        var list = res.data.waterbill_list;
        if(!isEmpty(list) && list.length >0){
            redirect("member-ticket.html");
        }else {
            //如果无水票 则判断店面是否关闭
            checkShopStatus();
        }
    }
    getData(member_waterbill,comParams(),success);
}


